//
//  VideoHomeCell.m
//  99Gold
//
//  Created by 刘海东 on 2016/11/30.
//  Copyright © 2016年 xia zhonglin . All rights reserved.
//

#import "VideoHomeCell.h"
#import "FinancialItemModel.h"

@interface VideoHomeCell () {
    UIImageView *_imageView;        //!<图片
    UILabel *_nameLabel;            //!<名称
}
@end


@implementation VideoHomeCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        _imageView = [[UIImageView alloc] init];
        _imageView.userInteractionEnabled = YES;
        _imageView.layer.masksToBounds = YES;
        _imageView.layer.cornerRadius = 5;
        [self addSubview:_imageView];
        [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.leading.equalTo(self).offset(20.0);
            make.width.height.mas_equalTo(35);
        }];
        
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.textColor = color_333333;
        _nameLabel.font = XCFONT(15);
        _nameLabel.textAlignment = NSTextAlignmentLeft;
        [self addSubview:_nameLabel];
        [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_imageView.mas_bottom).offset(5.0);
            make.leading.equalTo(_imageView);
        }];
    }
    return self;
}

- (void)setItemDataModel:(FinancialItemModel *)model indexPath:(NSIndexPath *)indexPath{
    
    _imageView.image = [UIImage imageNamed:model.imageName];
    _nameLabel.text = model.title;
}

@end
